package com.ycsj.goldmedalnewconcept.adapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;




import java.util.List;

import com.ycsj.goldmedalnewconcept.R;
import com.ycsj.goldmedalnewconcept.bean.GetRedInfo;

//import base.CommonAdapter;
//import base.ViewHolder;

/**
 * 创建日期：2017/11/7  15:21
 * 描述:红包记录的列表适配器
 * 作者:张伟
 */

public class GetRedLvAdapter extends CommonAdapter<GetRedInfo.RedPacketsBean.PersonsBean> {
    private Context context;

    public GetRedLvAdapter(Context context, List<GetRedInfo.RedPacketsBean.PersonsBean> datas, int layoutId) {
        super(context, datas, layoutId);
        this.context = context;
    }

    @Override
    public void convert(ViewHolder holder, final GetRedInfo.RedPacketsBean.PersonsBean bean) {
        //最外层的布局
        LinearLayout llOut = holder.getView(R.id.ll_out);

        //左边的图标
        ImageView lvLeft = holder.getView(R.id.lv_left);

        //标题
        TextView tvName = holder.getView(R.id.tv_name);
        tvName.setText(bean.getCustomer());

      //设置标题的颜色,1黑色,0灰色
        if("1".equals(bean.getStatus())){
        	tvName.setTextColor(context.getResources().getColor(R.color.red_black));
        }else{
        	tvName.setTextColor(context.getResources().getColor(R.color.red_gray));
        }

      
        
        
        //时间
        TextView tvTime = holder.getView(R.id.tv_time);
        tvTime.setText(bean.getGetDate() + "");

        //数量
        TextView tvNum = holder.getView(R.id.tv_money);
        tvNum.setText(bean.getMoney() + "");

        
        if("1".equals(bean.getStatus())){
        	tvNum.setTextColor(context.getResources().getColor(R.color.red_black));
        }else{
        	tvNum.setTextColor(context.getResources().getColor(R.color.red_gray));
        }

        //右边的相对布局
        RelativeLayout rlRight = holder.getView(R.id.rl_right);

    }
}
